<script>
export default {
    globalData: {
        socketObj:null
    },
    onLaunch: function () {
        console.log('App Launch')
        let storageInfo = uni.getStorageInfoSync();
        // #ifdef APP-PLUS
        //判断是否存在登录信息
        if (storageInfo.keys.indexOf('user') > -1) {
            uni.reLaunch({
                url: "/pages/index/index",
                success: () => {
                    //跳转完页面后再关闭启动页
                    plus.navigator.closeSplashscreen();
                }
            })
        } else {
            //不存在则跳转登录页
            uni.reLaunch({
                url: "/pages/login/login",
                success: () => {
                    //跳转完页面后再关闭启动页
                    plus.navigator.closeSplashscreen();
                }
            })
        }
        // #endif
    },
    onShow: function () {
        console.log('App Show')
        let storageInfo = uni.getStorageInfoSync();
    },
    onHide: function () {
        console.log('App Hide')
    }
}
</script>

<style>
* {
    padding: 0;
    margin: 0;
}

/*每个页面公共css */
</style>
